﻿using TopHero;
using UnityEngine;

public abstract class UnityObject : MonoBehaviour, IViewObject
{
    protected BaseEntity _linkedEntity;

    public virtual void Link(BaseEntity gameEntity)
    {
        _linkedEntity = gameEntity;
    }

    public virtual void Unlink()
    {
        _linkedEntity = null;
        if (gameObject != null)
        {
            Destroy(gameObject);
        }
    }
}